<?php
declare (strict_types = 1);
namespace app\index\model\order;

use think\Model;

/**
 * @mixin \think\Model
 */
class PileOrderCount extends Model
{
    protected $pk = "id";

    /**
     * 获取信息
     * @param $where
     * @return array|null|Model
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    function getInfoByWhere($where){
        return $this->where($where)->order('id','desc')->find();
    }

    /**
     * 更新记录
     * @param $id
     * @param $saveData
     * @return static
     */
    function saveData($id,$saveData){
        return $this->where('id',$id)->update($saveData);
    }

}
